<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:include page="/WEB-INF/templateFrontoffice/header.jsp"/>
<script src="<c:url value='/javascript/jquery.tablesorter.js'/>"></script>
<!-- <script src="<c:url value='/javascript/jquery.tablesorter.custom.js'/>"></script> -->
<script>
	$(document).ready(function(){$("#myTable").tablesorter({sortList:[[0,1]]});});
</script>
  <div id="container">
    <div id="top">
      <span id="arianne">
          <a href="<c:url value='/'/>">Accueil</a> > 
          <a href="<c:url value='/societe/liste'/>">Sociétés</a> >
          <a href="<c:url value='/societe?id=${param.id}'/>"><c:out value="${societe.nom}"/></a>
      </span>
      <br/>
      <div id="mainlarge">
        <h2><c:out value="${societe.nom}"/></h2>
        <p class="error">
        	${error}
        	<c:if test="${param.success == '1' }">Contrat créé</c:if>
        </p>
		<table style="line-height: 24px">
			<tr>
				<td class="bold" style="width:100px">Type</td>
				<td>${societe.type}</td>
			</tr>
			<tr>
				<td class="bold" style="width:100px">Secteur</td>
				<td>${societe.secteur}</td>
			</tr>
			<tr>
				<td class="bold">Capitalisation</td>
				<td>${societe.capitalisation}</td>
			</tr>
			<tr>
				<td class="bold">PER</td>
				<td>${societe.PER}</td>
			</tr>
			<tr>
				<td class="bold">BPA</td>
				<td>${societe.BPA}</td>
			</tr>
			<tr>
				<td class="bold">Description</td>
				<td>${societe.description}</td>
			</tr>
		</table>
		
		<c:if  test="${membre}">
			<a href="<c:url value='/masociete?action=edit'/>"><button>Editer</button></a>
		</c:if>
        <br/>
        <br/>
        <br/>
        <br/>
        <a href="<c:url value='/masociete/creeraction'/>"><button>Emettre action</button></a>
        <br/>
        <br/>
        <c:if test='${membre}'>
     	    <table id="myTable" class="CSSTableGenerator a_black format_listeTransaction">
	            <thead>
	                <tr>
	                    <th>
	                        ID Contrat 
	                        <img class="up" src="<c:url value='/images/arrow_up.png'/>" alt="up"/>
	                        <img class="down" src="<c:url value='/images/arrow_down.png'/>" alt="down"/>
	                    </th>
	                    <th>
	                        Propriétaire
	                        <img class="up" src="<c:url value='/images/arrow_up.png'/>" alt="up"/>
	                        <img class="down" src="<c:url value='/images/arrow_down.png'/>" alt="down"/>
	                    </th>
	                    <th style="width:150px">
	                        Type
	                        <img class="up" src="<c:url value='/images/arrow_up.png'/>" alt="up"/>
	                        <img class="down" src="<c:url value='/images/arrow_down.png'/>" alt="down"/>
	                    </th>
	                </tr>
	            </thead>
	            <tbody>
	                <c:forEach var="action" items="${actions}" varStatus="status">
	                <tr>
	                    <td><c:out value="${action.idContrat}"/></td>
	                    <td><c:out value="${action.possesseur.prenom} ${action.possesseur.nom}"/></td>
	                    <td>Action</td>
	                </tr>
	                </c:forEach>
	                
	                <c:forEach var="option" items="${options}" varStatus="status">
	                <tr>
	                    <td><c:out value="${option.idContrat}"/></td>
	                    <td><c:out value="${option.possesseur.prenom} ${option.possesseur.nom}"/></td>
	                    <td>Option</td>
	                </tr>
	                </c:forEach>
	            </tbody>
	        </table>
        </c:if>
        
      </div>
    <!--end bottom-->
  </div>
  </div>
<jsp:include page="/WEB-INF/templateFrontoffice/footer.jsp"/>